Skip to content

feat: persist wallet and session state securely#52

Merged
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
shadrach68:localStorage
Jun 28, 2026
Merged

feat: persist wallet and session state securely#52
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
shadrach68:localStorage

Conversation

@shadrach68

Copy link
Copy Markdown
Contributor

Summary This PR implements secure persistence for wallet and session states, ensuring users remain connected across app restarts without compromising sensitive data. It introduces a hybrid storage approach using AsyncStorage for non-sensitive preferences and Expo SecureStore for session tokens.

Key Changes

  • Hybrid Storage Architecture : Created a new storage utility that wraps AsyncStorage and SecureStore with standardized error handling.

  • State Persistence : Integrated Zustand persist middleware into wallet.store.ts and session.store.ts .

  • Smooth Rehydration : Updated the entry screen to handle the hydration lifecycle, preventing flashes of unauthenticated states during startup.

  • Secure Data Clearing : Enhanced the reset flow to purge all persisted data when a user logs out or resets the app.

  • Testing : Added a new storage test suite and global mocks to ensure reliable rehydration and storage error handling.
    Acceptance Criteria Verified

  • Wallet address is restored after app restart.

  • Startup flow waits for hydration before redirecting.

  • Session tokens are stored exclusively in Secure Storage.

  • Resetting app state clears all persisted data.

  • Storage errors are handled gracefully without crashing.

@Lakes41 Lakes41 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job

@Lakes41 Lakes41 merged commit a63044d into Adamantine-guild:main Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add secure local storage for wallet and session state

2 participants